package com.duolaibei.business.view.goods.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.duolaibei.business.view.goods.mode.FormatsBean;
import com.duolaibei.business.view.goods.mode.GoodsBean;
import com.duolaibei.business.view.goods.mode.TypesBean;

import com.duolaibei.business.view.goods.greendao.FormatsBeanDao;
import com.duolaibei.business.view.goods.greendao.GoodsBeanDao;
import com.duolaibei.business.view.goods.greendao.TypesBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig formatsBeanDaoConfig;
    private final DaoConfig goodsBeanDaoConfig;
    private final DaoConfig typesBeanDaoConfig;

    private final FormatsBeanDao formatsBeanDao;
    private final GoodsBeanDao goodsBeanDao;
    private final TypesBeanDao typesBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        formatsBeanDaoConfig = daoConfigMap.get(FormatsBeanDao.class).clone();
        formatsBeanDaoConfig.initIdentityScope(type);

        goodsBeanDaoConfig = daoConfigMap.get(GoodsBeanDao.class).clone();
        goodsBeanDaoConfig.initIdentityScope(type);

        typesBeanDaoConfig = daoConfigMap.get(TypesBeanDao.class).clone();
        typesBeanDaoConfig.initIdentityScope(type);

        formatsBeanDao = new FormatsBeanDao(formatsBeanDaoConfig, this);
        goodsBeanDao = new GoodsBeanDao(goodsBeanDaoConfig, this);
        typesBeanDao = new TypesBeanDao(typesBeanDaoConfig, this);

        registerDao(FormatsBean.class, formatsBeanDao);
        registerDao(GoodsBean.class, goodsBeanDao);
        registerDao(TypesBean.class, typesBeanDao);
    }
    
    public void clear() {
        formatsBeanDaoConfig.clearIdentityScope();
        goodsBeanDaoConfig.clearIdentityScope();
        typesBeanDaoConfig.clearIdentityScope();
    }

    public FormatsBeanDao getFormatsBeanDao() {
        return formatsBeanDao;
    }

    public GoodsBeanDao getGoodsBeanDao() {
        return goodsBeanDao;
    }

    public TypesBeanDao getTypesBeanDao() {
        return typesBeanDao;
    }

}
